package com.ler.yrmall.exception;

import com.ler.yrmall.enums.ErrorCodeEnum;

/**
 * @author Leron
 * @version 1.0
 */
public class BusinessException extends RuntimeException {

    private Integer code;

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorCodeEnum error) {
        super(error.getMessage());
        this.code = error.getCode();
    }

    public Integer getCode() {
        return code;
    }
}
